/**
 * 登陆demo
 * Created by wukai on 2016/3/18.
 */
exports.doLogin = function(req, res){
    var user={
        username:'admin',
        password:'admin'
    };
    if(req.body.username===user.username && req.body.password===user.password){
        req.session.user=user;
        return res.redirect('/home');
    } else {
        req.session.error='用户名或密码不正确';
        return res.redirect('/login');
    }
};